import {url,axios} from '.';
// import axios from 'axios';
export const usernameExist = async (username) => {
    let res = await axios({
        method:"post",
        url: url + '/users/usernameExist',
        data:{
            username
        }
    });
    return res.data;
}
export const reg = async (username,pwd) => {
    let res = await axios({
        method:"post",
        url: url + '/users/reg',
        data:{
            username,pwd
        }
    });
    return res.data;
}
export const getUser = async () => {
    let res = await axios({
        method:"get",
        url: url + '/getToken'
    });
    return res.data;
}
export const login = async (username,pwd) => {
    let res = await axios({
        method:"post",
        url: url + '/users/login',
        data:{
            username,pwd
        }
    });
    return res.data;
}
